package com.pearstack.sonic.core.protocol;

import java.nio.ByteBuffer;

public interface Protocol<T> {

    /**
     * 编码
     *
     * @param byteBuffer
     * */
    T encode(ByteBuffer byteBuffer);

    /**
     * 解码
     *
     * @param object
     * */
    ByteBuffer decode(T object);
}
